#!/bin/bash

# usage: ./<this-script> <name>
# example: ./<this-script> 07
set -xe

export new_file=$1

cp examples/01.cc examples/${new_file}.cc
echo "add_executable($new_file ${new_file}.cc)" >> examples/CMakeLists.txt
echo "target_link_libraries(${new_file} PUBLIC leveldb)" >> examples/CMakeLists.txt
